package net.xiaoyu233.mitemod.miteite.item.recipe;

import net.minecraft.Item;
import net.minecraft.ItemStack;

import net.minecraft.Item;
import net.minecraft.ItemStack;

public class FusionmineRecipe {
    private final ItemStack outputItem;
    private final int outputTime;
    private final Item[] inputItems;
    private final int[] inputAmounts;
    private final int outputAmount; // 每次合成的输出物品数量
    private final int outputheat; // 每次合成的输出物品数量

    public FusionmineRecipe(ItemStack outputItem, int outputTime, Item[] inputItems, int[] inputAmounts, int outputAmount, int outputheat) {
        this.outputItem = outputItem;
        this.outputTime = outputTime;
        this.inputItems = inputItems;
        this.inputAmounts = inputAmounts;
        this.outputAmount = outputAmount;
        this.outputheat = outputheat;
    }

    public ItemStack getOutputItem() {
        return outputItem;
    }

    public int getOutputTime() {
        return outputTime;
    }

    public Item[] getInputItems() {
        return inputItems;
    }

    public int[] getInputAmounts() {
        return inputAmounts;
    }

    public int getOutputAmount() {
        return outputAmount;
    }
    public int getoutputheat() {
        return outputheat;
    }

    public boolean matches(ItemStack[] inputStacks) {
        if (inputStacks.length != inputItems.length) {
            return false;
        }
        for (int i = 0; i < inputItems.length; i++) {
            if (inputStacks[i] == null || inputStacks[i].getItem() != inputItems[i] || inputStacks[i].stackSize < inputAmounts[i]) {
                return false;
            }
        }
        return true;
    }
    public boolean matchesInput(ItemStack stack) {
        for (Item inputItem : this.inputItems) {
            if (stack.getItem() == inputItem) {
                return true;
            }
        }
        return false;
    }
}
